home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / gnulib / sipp / libsipp / bezier_l.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-17  |  30.9 KB  |  1,160 lines

  1. /* A lexical scanner generated by flex */
  2.  
  3. /* scanner skeleton version:
  4.  * $Header: /usr/fsys/odin/a/vern/flex/RCS/flex.skel,v 2.16 90/08/03 14:09:36 vern Exp $
  5.  */
  6.  
  7. #define FLEX_SCANNER
  8.  
  9. #include <stdio.h>
  10.  
  11.  
  12. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  13. #ifdef c_plusplus
  14. #ifndef __cplusplus
  15. #define __cplusplus
  16. #endif
  17. #endif
  18.  
  19.  
  20. #ifdef __cplusplus
  21.  
  22. #include <stdlib.h>
  23. #include <osfcn.h>
  24.  
  25. /* use prototypes in function declarations */
  26. #define YY_USE_PROTOS
  27.  
  28. /* the "const" storage-class-modifier is valid */
  29. #define YY_USE_CONST
  30.  
  31. #else    /* ! __cplusplus */
  32.  
  33. #ifdef __STDC__
  34.  
  35. #ifdef __GNUC__
  36. #include <stddef.h>
  37. void *malloc( size_t );
  38. void free( void* );
  39. #else
  40. #include <stdlib.h>
  41. #endif    /* __GNUC__ */
  42.  
  43. #define YY_USE_PROTOS
  44. #define YY_USE_CONST
  45.  
  46. #endif    /* __STDC__ */
  47. #endif    /* ! __cplusplus */
  48.  
  49.  
  50. #ifdef __TURBOC__
  51. #define YY_USE_CONST
  52. #endif
  53.  
  54.  
  55. #ifndef YY_USE_CONST
  56. #define const
  57. #endif
  58.  
  59.  
  60. #ifdef YY_USE_PROTOS
  61. #define YY_PROTO(proto) proto
  62. #else
  63. #define YY_PROTO(proto) ()
  64. /* we can't get here if it's an ANSI C compiler, or a C++ compiler,
  65.  * so it's got to be a K&R compiler, and therefore there's no standard
  66.  * place from which to include these definitions
  67.  */
  68. char *malloc();
  69. int free();
  70. int read();
  71. #endif
  72.  
  73.  
  74. /* amount of stuff to slurp up with each read */
  75. #ifndef YY_READ_BUF_SIZE
  76. #define YY_READ_BUF_SIZE 8192
  77. #endif
  78.  
  79. /* returned upon end-of-file */
  80. #define YY_END_TOK 0
  81.  
  82. /* copy whatever the last rule matched to the standard output */
  83.  
  84. /* cast to (char *) is because for 8-bit chars, yytext is (unsigned char *) */
  85. /* this used to be an fputs(), but since the string might contain NUL's,
  86.  * we now use fwrite()
  87.  */
  88. #define ECHO (void) fwrite( (char *) yytext, yyleng, 1, yyout )
  89.  
  90. /* gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  91.  * is returned in "result".
  92.  */
  93. #define YY_INPUT(buf,result,max_size) \
  94.     if ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \
  95.         YY_FATAL_ERROR( "read() in flex scanner failed" );
  96. #define YY_NULL 0
  97.  
  98. /* no semi-colon after return; correct usage is to write "yyterminate();" -
  99.  * we don't want an extra ';' after the "return" because that will cause
  100.  * some compilers to complain about unreachable statements.
  101.  */
  102. #define yyterminate() return ( YY_NULL )
  103.  
  104. /* report a fatal error */
  105.  
  106. /* The funky do-while is used to turn this macro definition into
  107.  * a single C statement (which needs a semi-colon terminator).
  108.  * This avoids problems with code like:
  109.  *
  110.  *     if ( something_happens )
  111.  *        YY_FATAL_ERROR( "oops, the something happened" );
  112.  *    else
  113.  *        everything_okay();
  114.  *
  115.  * Prior to using the do-while the compiler would get upset at the
  116.  * "else" because it interpreted the "if" statement as being all
  117.  * done when it reached the ';' after the YY_FATAL_ERROR() call.
  118.  */
  119.  
  120. #define YY_FATAL_ERROR(msg) \
  121.     do \
  122.         { \
  123.         (void) fputs( msg, stderr ); \
  124.         (void) putc( '\n', stderr ); \
  125.         exit( 1 ); \
  126.         } \
  127.     while ( 0 )
  128.  
  129. /* default yywrap function - always treat EOF as an EOF */
  130. #define yywrap() 1
  131.  
  132. /* enter a start condition.  This macro really ought to take a parameter,
  133.  * but we do it the disgusting crufty way forced on us by the ()-less
  134.  * definition of BEGIN
  135.  */
  136. #define BEGIN yy_start = 1 + 2 *
  137.  
  138. /* action number for EOF rule of a given start state */
  139. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  140.  
  141. /* special action meaning "start processing a new file" */
  142. #define YY_NEW_FILE \
  143.     do \
  144.         { \
  145.         yy_init_buffer( yy_current_buffer, yyin ); \
  146.         yy_load_buffer_state(); \
  147.         } \
  148.     while ( 0 )
  149.  
  150. /* default declaration of generated scanner - a define so the user can
  151.  * easily add parameters
  152.  */
  153. #define YY_DECL int yylex YY_PROTO(( void )) 
  154.  
  155. /* code executed at the end of each rule */
  156. #define YY_BREAK break;
  157.  
  158. #define YY_END_OF_BUFFER_CHAR 0
  159.  
  160. #ifndef YY_BUF_SIZE
  161. #define YY_BUF_SIZE (YY_READ_BUF_SIZE * 2) /* size of default input buffer */
  162. #endif
  163.  
  164. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  165.  
  166. #define YY_CHAR unsigned char
  167. # line 1 "bezier_l.l"
  168. #define INITIAL 0
  169. # line 2 "bezier_l.l"
  170. /**
  171.  ** sipp - SImple Polygon Processor
  172.  **
  173.  **  A general 3d graphic package
  174.  **
  175.  **  Copyright Equivalent Software HB  1992
  176.  **
  177.  ** This program is free software; you can redistribute it and/or modify
  178.  ** it under the terms of the GNU General Public License as published by
  179.  ** the Free Software Foundation; either version 1, or any later version.
  180.  ** This program is distributed in the hope that it will be useful,
  181.  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  182.  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  183.  ** GNU General Public License for more details.
  184.  ** You can receive a copy of the GNU General Public License from the
  185.  ** Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  186.  **/
  187.  
  188. /**
  189.  ** bezier_lex.l - Lex source for reading bezier descriptions.
  190.  **/
  191.  
  192. #include "bezier.h"
  193.  
  194. extern int     atoi();
  195. extern double  atof();
  196.  
  197. extern Tokenval  tokenval;
  198. extern FILE     *bezier_file;
  199. # line 32 "bezier_l.l"
  200.  
  201. /* done after the current pattern has been matched and before the
  202.  * corresponding action - sets up yytext
  203.  */
  204. #define YY_DO_BEFORE_ACTION \
  205.     yytext = yy_bp; \
  206.     yyleng = yy_cp - yy_bp; \
  207.     yy_hold_char = *yy_cp; \
  208.     *yy_cp = '\0'; \
  209.     yy_c_buf_p = yy_cp;
  210.  
  211. #define EOB_ACT_CONTINUE_SCAN 0
  212. #define EOB_ACT_END_OF_FILE 1
  213. #define EOB_ACT_LAST_MATCH 2
  214.  
  215. /* return all but the first 'n' matched characters back to the input stream */
  216. #define yyless(n) \
  217.     do \
  218.         { \
  219.         /* undo effects of setting up yytext */ \
  220.         *yy_cp = yy_hold_char; \
  221.         yy_c_buf_p = yy_cp = yy_bp + n; \
  222.         YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  223.         } \
  224.     while ( 0 )
  225.  
  226. #define unput(c) yyunput( c, yytext )
  227.  
  228.  
  229. struct yy_buffer_state
  230.     {
  231.     FILE *yy_input_file;
  232.  
  233.     YY_CHAR *yy_ch_buf;        /* input buffer */
  234.     YY_CHAR *yy_buf_pos;    /* current position in input buffer */
  235.  
  236.     /* size of input buffer in bytes, not including room for EOB characters*/
  237.     int yy_buf_size;    
  238.  
  239.     /* number of characters read into yy_ch_buf, not including EOB characters */
  240.     int yy_n_chars;
  241.  
  242.     int yy_eof_status;        /* whether we've seen an EOF on this buffer */
  243. #define EOF_NOT_SEEN 0
  244.     /* "pending" happens when the EOF has been seen but there's still
  245.      * some text process
  246.      */
  247. #define EOF_PENDING 1
  248. #define EOF_DONE 2
  249.     };
  250.  
  251. static YY_BUFFER_STATE yy_current_buffer;
  252.  
  253. /* we provide macros for accessing buffer states in case in the
  254.  * future we want to put the buffer states in a more general
  255.  * "scanner state"
  256.  */
  257. #define YY_CURRENT_BUFFER yy_current_buffer
  258.  
  259.  
  260. /* yy_hold_char holds the character lost when yytext is formed */
  261. static YY_CHAR yy_hold_char;
  262.  
  263. static int yy_n_chars;        /* number of characters read into yy_ch_buf */
  264.  
  265.  
  266.  
  267. #ifndef YY_USER_ACTION
  268. #define YY_USER_ACTION
  269. #endif
  270.  
  271. #ifndef YY_USER_INIT
  272. #define YY_USER_INIT
  273. #endif
  274.  
  275. extern YY_CHAR *yytext;
  276. extern int yyleng;
  277. extern FILE *yyin, *yyout;
  278.  
  279. YY_CHAR *yytext;
  280. int yyleng;
  281.  
  282. FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
  283.  
  284. #define YY_END_OF_BUFFER 15
  285. typedef int yy_state_type;
  286. static const short int yy_acclist[39] =
  287.     {   0,
  288.        15,   13,   14,   11,   13,   14,   11,   14,   13,   14,
  289.     16396,   13,   14,    9,   13,   14,   13,   14,   13,   14,
  290.        13,   14,   13,   14,16396, 8204,    9,   10,   10,   10,
  291.         5,    4,    3,    8,    7,    6,    2,    1
  292.     } ;
  293.  
  294. static const short int yy_accept[86] =
  295.     {   0,
  296.         1,    1,    1,    2,    4,    7,    9,   12,   14,   17,
  297.        19,   21,   23,   25,   26,   27,   28,   29,   29,   29,
  298.        29,   29,   30,   30,   30,   30,   30,   30,   30,   31,
  299.        31,   31,   31,   31,   31,   31,   31,   31,   31,   31,
  300.        31,   31,   31,   31,   31,   31,   31,   31,   32,   32,
  301.        32,   32,   32,   32,   32,   32,   32,   33,   33,   33,
  302.        33,   33,   33,   33,   33,   34,   34,   34,   34,   34,
  303.        34,   34,   34,   35,   36,   36,   36,   36,   37,   37,
  304.        37,   38,   38,   39,   39
  305.     } ;
  306.  
  307. static const YY_CHAR yy_ec[256] =
  308.     {   0,
  309.         1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
  310.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  311.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  312.         1,    2,    1,    1,    4,    1,    1,    1,    1,    1,
  313.         1,    1,    5,    1,    6,    7,    1,    8,    8,    8,
  314.         8,    8,    8,    8,    8,    8,    8,    9,    1,    1,
  315.         1,    1,    1,    1,    1,    1,    1,    1,   10,    1,
  316.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  317.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  318.         1,    1,    1,    1,   11,    1,   12,   13,   14,    1,
  319.  
  320.        15,    1,    1,   16,   17,    1,    1,   18,    1,    1,
  321.         1,   19,    1,   20,   21,   22,   23,   24,    1,   25,
  322.         1,   26,    1,    1,    1,    1,    1,    1,    1,    1,
  323.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  324.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  325.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  326.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  327.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  328.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  329.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  330.  
  331.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  332.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  333.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  334.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  335.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  336.         1,    1,    1,    1,    1
  337.     } ;
  338.  
  339. static const YY_CHAR yy_meta[27] =
  340.     {   0,
  341.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  342.         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
  343.         1,    1,    1,    1,    1,    1
  344.     } ;
  345.  
  346. static const short int yy_base[87] =
  347.     {   0,
  348.         0,   23,  102,  103,  103,  103,   98,   92,    2,   84,
  349.        75,   85,   81,   92,  103,    4,    7,   68,   73,   70,
  350.        71,    8,   27,   73,   65,   74,   65,   78,   77,   69,
  351.        68,   66,   13,   61,   23,   28,   55,   65,   67,   59,
  352.        67,   57,   53,   62,   57,   26,   54,  103,   53,   60,
  353.        50,   46,   43,   53,   43,   42,  103,   45,   52,   40,
  354.        37,   36,   35,   35,  103,   31,   40,   44,   43,   29,
  355.        35,   33,  103,  103,   39,   25,   26,  103,   29,    0,
  356.       103,   11,  103,  103,    4,    0
  357.     } ;
  358.  
  359. static const short int yy_def[87] =
  360.     {   0,
  361.        85,   85,   84,   84,   84,   84,   86,   84,   84,   84,
  362.        84,   84,   84,   86,   84,   84,   84,   84,   84,   84,
  363.        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
  364.        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
  365.        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
  366.        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
  367.        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
  368.        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
  369.        84,   84,   84,    0,   84,   84
  370.     } ;
  371.  
  372. static const short int yy_nxt[130] =
  373.     {   0,
  374.        14,    5,    6,    7,    4,    8,   84,    9,   17,   16,
  375.        17,   16,   10,   11,   22,   22,   23,   23,   12,   83,
  376.        82,   23,   23,   13,    5,    6,    7,   37,    8,   38,
  377.         9,   28,   28,   40,   29,   10,   11,   81,   42,   53,
  378.        80,   12,   43,   41,   54,   79,   13,   78,   77,   76,
  379.        75,   74,   73,   72,   71,   70,   69,   68,   67,   66,
  380.        65,   64,   63,   62,   61,   60,   59,   58,   57,   56,
  381.        55,   52,   51,   50,   49,   48,   47,   46,   45,   44,
  382.        39,   36,   35,   34,   29,   29,   33,   32,   31,   30,
  383.        27,   26,   25,   24,   15,   21,   20,   19,   18,   16,
  384.  
  385.        15,   84,    3,   84,   84,   84,   84,   84,   84,   84,
  386.        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
  387.        84,   84,   84,   84,   84,   84,   84,   84,   84
  388.     } ;
  389.  
  390. static const short int yy_chk[130] =
  391.     {   0,
  392.        86,    1,    1,    1,   85,    1,    0,    1,    9,    9,
  393.        16,   16,    1,    1,   17,   22,   17,   22,    1,   82,
  394.        80,   17,   22,    1,    2,    2,    2,   33,    2,   33,
  395.         2,   23,   23,   35,   23,    2,    2,   79,   36,   46,
  396.        77,    2,   36,   35,   46,   76,    2,   75,   72,   71,
  397.        70,   69,   68,   67,   66,   64,   63,   62,   61,   60,
  398.        59,   58,   56,   55,   54,   53,   52,   51,   50,   49,
  399.        47,   45,   44,   43,   42,   41,   40,   39,   38,   37,
  400.        34,   32,   31,   30,   29,   28,   27,   26,   25,   24,
  401.        21,   20,   19,   18,   14,   13,   12,   11,   10,    8,
  402.  
  403.         7,    3,   84,   84,   84,   84,   84,   84,   84,   84,
  404.        84,   84,   84,   84,   84,   84,   84,   84,   84,   84,
  405.        84,   84,   84,   84,   84,   84,   84,   84,   84
  406.     } ;
  407.  
  408. static yy_state_type yy_last_accepting_state;
  409. static YY_CHAR *yy_last_accepting_cpos;
  410.  
  411. static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;
  412. static YY_CHAR *yy_full_match;
  413. static int yy_lp;
  414. static int yy_looking_for_trail_begin = 0;
  415. static int yy_full_lp;
  416. static int *yy_full_state;
  417. #define YY_TRAILING_MASK 0x2000
  418. #define YY_TRAILING_HEAD_MASK 0x4000
  419. #define REJECT \
  420. { \
  421. *yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \
  422. yy_cp = yy_full_match; /* restore poss. backed-over text */ \
  423. yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \
  424. yy_state_ptr = yy_full_state; /* restore orig. state */ \
  425. yy_current_state = *yy_state_ptr; /* restore curr. state */ \
  426. ++yy_lp; \
  427. goto find_rule; \
  428. }
  429. #define yymore() yymore_used_but_not_detected
  430. #define YY_MORE_ADJ 0
  431.  
  432. /* these variables are all declared out here so that section 3 code can
  433.  * manipulate them
  434.  */
  435. /* points to current character in buffer */
  436. static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
  437. static int yy_init = 1;        /* whether we need to initialize */
  438. static int yy_start = 0;    /* start state number */
  439.  
  440. /* flag which is used to allow yywrap()'s to do buffer switches
  441.  * instead of setting up a fresh yyin.  A bit of a hack ...
  442.  */
  443. static int yy_did_buffer_switch_on_eof;
  444.  
  445. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  446. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  447. static int yy_get_next_buffer YY_PROTO(( void ));
  448. static void yyunput YY_PROTO(( YY_CHAR c, YY_CHAR *buf_ptr ));
  449. void yyrestart YY_PROTO(( FILE *input_file ));
  450. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  451. void yy_load_buffer_state YY_PROTO(( void ));
  452. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  453. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  454. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  455.  
  456. #define yy_new_buffer yy_create_buffer
  457.  
  458. #ifdef __cplusplus
  459. static int yyinput YY_PROTO(( void ));
  460. #else
  461. static int input YY_PROTO(( void ));
  462. #endif
  463.  
  464. YY_DECL
  465.     {
  466.     register yy_state_type yy_current_state;
  467.     register YY_CHAR *yy_cp, *yy_bp;
  468.     register int yy_act;
  469.  
  470.  
  471.  
  472.  
  473.     if ( yy_init )
  474.     {
  475.     YY_USER_INIT;
  476.  
  477.     if ( ! yy_start )
  478.         yy_start = 1;    /* first start state */
  479.  
  480.     if ( ! yyin )
  481.         yyin = stdin;
  482.  
  483.     if ( ! yyout )
  484.         yyout = stdout;
  485.  
  486.     if ( yy_current_buffer )
  487.         yy_init_buffer( yy_current_buffer, yyin );
  488.     else
  489.         yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  490.  
  491.     yy_load_buffer_state();
  492.  
  493.     yy_init = 0;
  494.     }
  495.  
  496.     while ( 1 )        /* loops until end-of-file is reached */
  497.     {
  498.     yy_cp = yy_c_buf_p;
  499.  
  500.     /* support of yytext */
  501.     *yy_cp = yy_hold_char;
  502.  
  503.     /* yy_bp points to the position in yy_ch_buf of the start of the
  504.      * current run.
  505.      */
  506.     yy_bp = yy_cp;
  507.  
  508.     yy_current_state = yy_start;
  509.     yy_state_ptr = yy_state_buf;
  510.     *yy_state_ptr++ = yy_current_state;
  511. yy_match:
  512.     do
  513.         {
  514.         register YY_CHAR yy_c = yy_ec[*yy_cp];
  515.         while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  516.         {
  517.         yy_current_state = yy_def[yy_current_state];
  518.         if ( yy_current_state >= 85 )
  519.             yy_c = yy_meta[yy_c];
  520.         }
  521.         yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  522.         *yy_state_ptr++ = yy_current_state;
  523.         ++yy_cp;
  524.         }
  525.     while ( yy_current_state != 84 );
  526.  
  527. yy_find_action:
  528.     yy_current_state = *--yy_state_ptr;
  529.     yy_lp = yy_accept[yy_current_state];
  530. find_rule: /* we branch to this label when backtracking */
  531.     for ( ; ; ) /* until we find what rule we matched */
  532.         {
  533.         if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )
  534.         {
  535.         yy_act = yy_acclist[yy_lp];
  536.         if ( yy_act & YY_TRAILING_HEAD_MASK ||
  537.              yy_looking_for_trail_begin )
  538.             {
  539.             if ( yy_act == yy_looking_for_trail_begin )
  540.             {
  541.             yy_looking_for_trail_begin = 0;
  542.             yy_act &= ~YY_TRAILING_HEAD_MASK;
  543.             break;
  544.             }
  545.             }
  546.         else if ( yy_act & YY_TRAILING_MASK )
  547.             {
  548.             yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
  549.             yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
  550.             }
  551.         else
  552.             {
  553.             yy_full_match = yy_cp;
  554.             yy_full_state = yy_state_ptr;
  555.             yy_full_lp = yy_lp;
  556.             break;
  557.             }
  558.         ++yy_lp;
  559.         goto find_rule;
  560.         }
  561.         --yy_cp;
  562.         yy_current_state = *--yy_state_ptr;
  563.         yy_lp = yy_accept[yy_current_state];
  564.         }
  565.  
  566.     YY_DO_BEFORE_ACTION;
  567.     YY_USER_ACTION;
  568.  
  569. do_action:    /* this label is used only to access EOF actions */
  570.  
  571.  
  572.     switch ( yy_act )
  573.         {
  574. case 1:
  575. # line 34 "bezier_l.l"
  576. {return PATCHES;}
  577.     YY_BREAK
  578. case 2:
  579. # line 35 "bezier_l.l"
  580. {return CURVES;}
  581.     YY_BREAK
  582. case 3:
  583. # line 36 "bezier_l.l"
  584. {return NVERTICES;}
  585.     YY_BREAK
  586. case 4:
  587. # line 37 "bezier_l.l"
  588. {return NPATCHES;}
  589.     YY_BREAK
  590. case 5:
  591. # line 38 "bezier_l.l"
  592. {return NCURVES;}
  593.     YY_BREAK
  594. case 6:
  595. # line 39 "bezier_l.l"
  596. {return VERTEX_LIST;}
  597.     YY_BREAK
  598. case 7:
  599. # line 40 "bezier_l.l"
  600. {return PATCH_LIST;}
  601.     YY_BREAK
  602. case 8:
  603. # line 41 "bezier_l.l"
  604. {return CURVE_LIST;}
  605.     YY_BREAK
  606. case 9:
  607. # line 43 "bezier_l.l"
  608. {tokenval.intval = atoi(yytext);
  609.                          return INTEGER;
  610.                         }
  611.     YY_BREAK
  612. case 10:
  613. # line 46 "bezier_l.l"
  614. {tokenval.floatval = atof(yytext);
  615.                                       return FLOAT;
  616.                                      }
  617.     YY_BREAK
  618. case 11:
  619. # line 50 "bezier_l.l"
  620. {}
  621.     YY_BREAK
  622. case 12:
  623. # line 51 "bezier_l.l"
  624. { /* This is a comment */ }
  625.     YY_BREAK
  626. case 13:
  627. # line 52 "bezier_l.l"
  628. { return yytext[0]; /* We found something wrong */ }
  629.     YY_BREAK
  630. case 14:
  631. # line 54 "bezier_l.l"
  632. ECHO;
  633.     YY_BREAK
  634.         case YY_STATE_EOF(INITIAL):
  635.         yyterminate();
  636.  
  637.         case YY_END_OF_BUFFER:
  638.         {
  639.         /* amount of text matched not including the EOB char */
  640.         int yy_amount_of_matched_text = yy_cp - yytext - 1;
  641.  
  642.         /* undo the effects of YY_DO_BEFORE_ACTION */
  643.         *yy_cp = yy_hold_char;
  644.  
  645.         /* note that here we test for yy_c_buf_p "<=" to the position
  646.          * of the first EOB in the buffer, since yy_c_buf_p will
  647.          * already have been incremented past the NUL character
  648.          * (since all states make transitions on EOB to the end-
  649.          * of-buffer state).  Contrast this with the test in yyinput().
  650.          */
  651.         if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  652.             /* this was really a NUL */
  653.             {
  654.             yy_state_type yy_next_state;
  655.  
  656.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  657.  
  658.             yy_current_state = yy_get_previous_state();
  659.  
  660.             /* okay, we're now positioned to make the
  661.              * NUL transition.  We couldn't have
  662.              * yy_get_previous_state() go ahead and do it
  663.              * for us because it doesn't know how to deal
  664.              * with the possibility of jamming (and we
  665.              * don't want to build jamming into it because
  666.              * then it will run more slowly)
  667.              */
  668.  
  669.             yy_next_state = yy_try_NUL_trans( yy_current_state );
  670.  
  671.             yy_bp = yytext + YY_MORE_ADJ;
  672.  
  673.             if ( yy_next_state )
  674.             {
  675.             /* consume the NUL */
  676.             yy_cp = ++yy_c_buf_p;
  677.             yy_current_state = yy_next_state;
  678.             goto yy_match;
  679.             }
  680.  
  681.             else
  682.             {
  683.             goto yy_find_action;
  684.             }
  685.             }
  686.  
  687.         else switch ( yy_get_next_buffer() )
  688.             {
  689.             case EOB_ACT_END_OF_FILE:
  690.             {
  691.             yy_did_buffer_switch_on_eof = 0;
  692.  
  693.             if ( yywrap() )
  694.                 {
  695.                 /* note: because we've taken care in
  696.                  * yy_get_next_buffer() to have set up yytext,
  697.                  * we can now set up yy_c_buf_p so that if some
  698.                  * total hoser (like flex itself) wants
  699.                  * to call the scanner after we return the
  700.                  * YY_NULL, it'll still work - another YY_NULL
  701.                  * will get returned.
  702.                  */
  703.                 yy_c_buf_p = yytext + YY_MORE_ADJ;
  704.  
  705.                 yy_act = YY_STATE_EOF((yy_start - 1) / 2);
  706.                 goto do_action;
  707.                 }
  708.  
  709.             else
  710.                 {
  711.                 if ( ! yy_did_buffer_switch_on_eof )
  712.                 YY_NEW_FILE;
  713.                 }
  714.             }
  715.             break;
  716.  
  717.             case EOB_ACT_CONTINUE_SCAN:
  718.             yy_c_buf_p = yytext + yy_amount_of_matched_text;
  719.  
  720.             yy_current_state = yy_get_previous_state();
  721.  
  722.             yy_cp = yy_c_buf_p;
  723.             yy_bp = yytext + YY_MORE_ADJ;
  724.             goto yy_match;
  725.  
  726.             case EOB_ACT_LAST_MATCH:
  727.             yy_c_buf_p =
  728.                 &yy_current_buffer->yy_ch_buf[yy_n_chars];
  729.  
  730.             yy_current_state = yy_get_previous_state();
  731.  
  732.             yy_cp = yy_c_buf_p;
  733.             yy_bp = yytext + YY_MORE_ADJ;
  734.             goto yy_find_action;
  735.             }
  736.         break;
  737.         }
  738.  
  739.         default:
  740. #ifdef FLEX_DEBUG
  741.         printf( "action # %d\n", yy_act );
  742. #endif
  743.         YY_FATAL_ERROR(
  744.             "fatal flex scanner internal error--no action found" );
  745.         }
  746.     }
  747.     }
  748.  
  749.  
  750. /* yy_get_next_buffer - try to read in a new buffer
  751.  *
  752.  * synopsis
  753.  *     int yy_get_next_buffer();
  754.  *     
  755.  * returns a code representing an action
  756.  *     EOB_ACT_LAST_MATCH - 
  757.  *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  758.  *     EOB_ACT_END_OF_FILE - end of file
  759.  */
  760.  
  761. static int yy_get_next_buffer()
  762.  
  763.     {
  764.     register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
  765.     register YY_CHAR *source = yytext - 1; /* copy prev. char, too */
  766.     register int number_to_move, i;
  767.     int ret_val;
  768.  
  769.     if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  770.     YY_FATAL_ERROR(
  771.         "fatal flex scanner internal error--end of buffer missed" );
  772.  
  773.     /* try to read more data */
  774.  
  775.     /* first move last chars to start of buffer */
  776.     number_to_move = yy_c_buf_p - yytext;
  777.  
  778.     for ( i = 0; i < number_to_move; ++i )
  779.     *(dest++) = *(source++);
  780.  
  781.     if ( yy_current_buffer->yy_eof_status != EOF_NOT_SEEN )
  782.     /* don't do the read, it's not guaranteed to return an EOF,
  783.      * just force an EOF
  784.      */
  785.     yy_n_chars = 0;
  786.  
  787.     else
  788.     {
  789.     int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1;
  790.  
  791.     if ( num_to_read > YY_READ_BUF_SIZE )
  792.         num_to_read = YY_READ_BUF_SIZE;
  793.  
  794.     else if ( num_to_read <= 0 )
  795.         YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" );
  796.  
  797.     /* read in more data */
  798.     YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  799.           yy_n_chars, num_to_read );
  800.     }
  801.  
  802.     if ( yy_n_chars == 0 )
  803.     {
  804.     if ( number_to_move == 1 )
  805.         {
  806.         ret_val = EOB_ACT_END_OF_FILE;
  807.         yy_current_buffer->yy_eof_status = EOF_DONE;
  808.         }
  809.  
  810.     else
  811.         {
  812.         ret_val = EOB_ACT_LAST_MATCH;
  813.         yy_current_buffer->yy_eof_status = EOF_PENDING;
  814.         }
  815.     }
  816.  
  817.     else
  818.     ret_val = EOB_ACT_CONTINUE_SCAN;
  819.  
  820.     yy_n_chars += number_to_move;
  821.     yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  822.     yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  823.  
  824.     /* yytext begins at the second character in yy_ch_buf; the first
  825.      * character is the one which preceded it before reading in the latest
  826.      * buffer; it needs to be kept around in case it's a newline, so
  827.      * yy_get_previous_state() will have with '^' rules active
  828.      */
  829.  
  830.     yytext = &yy_current_buffer->yy_ch_buf[1];
  831.  
  832.     return ( ret_val );
  833.     }
  834.  
  835.  
  836. /* yy_get_previous_state - get the state just before the EOB char was reached
  837.  *
  838.  * synopsis
  839.  *     yy_state_type yy_get_previous_state();
  840.  */
  841.  
  842. static yy_state_type yy_get_previous_state()
  843.  
  844.     {
  845.     register yy_state_type yy_current_state;
  846.     register YY_CHAR *yy_cp;
  847.  
  848.     yy_current_state = yy_start;
  849.     yy_state_ptr = yy_state_buf;
  850.     *yy_state_ptr++ = yy_current_state;
  851.  
  852.     for ( yy_cp = yytext + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  853.     {
  854.     register YY_CHAR yy_c = (*yy_cp ? yy_ec[*yy_cp] : 1);
  855.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  856.         {
  857.         yy_current_state = yy_def[yy_current_state];
  858.         if ( yy_current_state >= 85 )
  859.         yy_c = yy_meta[yy_c];
  860.         }
  861.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  862.     *yy_state_ptr++ = yy_current_state;
  863.     }
  864.  
  865.     return ( yy_current_state );
  866.     }
  867.  
  868.  
  869. /* yy_try_NUL_trans - try to make a transition on the NUL character
  870.  *
  871.  * synopsis
  872.  *     next_state = yy_try_NUL_trans( current_state );
  873.  */
  874.  
  875. #ifdef YY_USE_PROTOS
  876. static yy_state_type yy_try_NUL_trans( register yy_state_type yy_current_state )
  877. #else
  878. static yy_state_type yy_try_NUL_trans( yy_current_state )
  879. register yy_state_type yy_current_state;
  880. #endif
  881.  
  882.     {
  883.     register int yy_is_jam;
  884.  
  885.     register YY_CHAR yy_c = 1;
  886.     while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
  887.     {
  888.     yy_current_state = yy_def[yy_current_state];
  889.     if ( yy_current_state >= 85 )
  890.         yy_c = yy_meta[yy_c];
  891.     }
  892.     yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
  893.     *yy_state_ptr++ = yy_current_state;
  894.     yy_is_jam = (yy_current_state == 84);
  895.  
  896.     return ( yy_is_jam ? 0 : yy_current_state );
  897.     }
  898.  
  899.  
  900. #ifdef YY_USE_PROTOS
  901. static void yyunput( YY_CHAR c, register YY_CHAR *yy_bp )
  902. #else
  903. static void yyunput( c, yy_bp )
  904. YY_CHAR c;
  905. register YY_CHAR *yy_bp;
  906. #endif
  907.  
  908.     {
  909.     register YY_CHAR *yy_cp = yy_c_buf_p;
  910.  
  911.     /* undo effects of setting up yytext */
  912.     *yy_cp = yy_hold_char;
  913.  
  914.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  915.     { /* need to shift things up to make room */
  916.     register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */
  917.     register YY_CHAR *dest =
  918.         &yy_current_buffer->yy_ch_buf[yy_current_buffer->yy_buf_size + 2];
  919.     register YY_CHAR *source =
  920.         &yy_current_buffer->yy_ch_buf[number_to_move];
  921.  
  922.     while ( source > yy_current_buffer->yy_ch_buf )
  923.         *--dest = *--source;
  924.  
  925.     yy_cp += dest - source;
  926.     yy_bp += dest - source;
  927.     yy_n_chars = yy_current_buffer->yy_buf_size;
  928.  
  929.     if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  930.         YY_FATAL_ERROR( "flex scanner push-back overflow" );
  931.     }
  932.  
  933.     if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
  934.     yy_cp[-2] = '\n';
  935.  
  936.     *--yy_cp = c;
  937.  
  938.     /* note: the formal parameter *must* be called "yy_bp" for this
  939.      *       macro to now work correctly
  940.      */
  941.     YY_DO_BEFORE_ACTION; /* set up yytext again */
  942.     }
  943.  
  944.  
  945. #ifdef __cplusplus
  946. static int yyinput()
  947. #else
  948. static int input()
  949. #endif
  950.  
  951.     {
  952.     int c;
  953.     YY_CHAR *yy_cp = yy_c_buf_p;
  954.  
  955.     *yy_cp = yy_hold_char;
  956.  
  957.     if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  958.     {
  959.     /* yy_c_buf_p now points to the character we want to return.
  960.      * If this occurs *before* the EOB characters, then it's a
  961.      * valid NUL; if not, then we've hit the end of the buffer.
  962.      */
  963.     if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  964.         /* this was really a NUL */
  965.         *yy_c_buf_p = '\0';
  966.  
  967.     else
  968.         { /* need more input */
  969.         yytext = yy_c_buf_p;
  970.         ++yy_c_buf_p;
  971.  
  972.         switch ( yy_get_next_buffer() )
  973.         {
  974.         case EOB_ACT_END_OF_FILE:
  975.             {
  976.             if ( yywrap() )
  977.             {
  978.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  979.             return ( EOF );
  980.             }
  981.  
  982.             YY_NEW_FILE;
  983.  
  984. #ifdef __cplusplus
  985.             return ( yyinput() );
  986. #else
  987.             return ( input() );
  988. #endif
  989.             }
  990.             break;
  991.  
  992.         case EOB_ACT_CONTINUE_SCAN:
  993.             yy_c_buf_p = yytext + YY_MORE_ADJ;
  994.             break;
  995.  
  996.         case EOB_ACT_LAST_MATCH:
  997. #ifdef __cplusplus
  998.             YY_FATAL_ERROR( "unexpected last match in yyinput()" );
  999. #else
  1000.             YY_FATAL_ERROR( "unexpected last match in input()" );
  1001. #endif
  1002.         }
  1003.         }
  1004.     }
  1005.  
  1006.     c = *yy_c_buf_p;
  1007.     yy_hold_char = *++yy_c_buf_p;
  1008.  
  1009.     return ( c );
  1010.     }
  1011.  
  1012.  
  1013. #ifdef YY_USE_PROTOS
  1014. void yyrestart( FILE *input_file )
  1015. #else
  1016. void yyrestart( input_file )
  1017. FILE *input_file;
  1018. #endif
  1019.  
  1020.     {
  1021.     yy_init_buffer( yy_current_buffer, input_file );
  1022.     yy_load_buffer_state();
  1023.     }
  1024.  
  1025.  
  1026. #ifdef YY_USE_PROTOS
  1027. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  1028. #else
  1029. void yy_switch_to_buffer( new_buffer )
  1030. YY_BUFFER_STATE new_buffer;
  1031. #endif
  1032.  
  1033.     {
  1034.     if ( yy_current_buffer == new_buffer )
  1035.     return;
  1036.  
  1037.     if ( yy_current_buffer )
  1038.     {
  1039.     /* flush out information for old buffer */
  1040.     *yy_c_buf_p = yy_hold_char;
  1041.     yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  1042.     yy_current_buffer->yy_n_chars = yy_n_chars;
  1043.     }
  1044.  
  1045.     yy_current_buffer = new_buffer;
  1046.     yy_load_buffer_state();
  1047.  
  1048.     /* we don't actually know whether we did this switch during
  1049.      * EOF (yywrap()) processing, but the only time this flag
  1050.      * is looked at is after yywrap() is called, so it's safe
  1051.      * to go ahead and always set it.
  1052.      */
  1053.     yy_did_buffer_switch_on_eof = 1;
  1054.     }
  1055.  
  1056.  
  1057. #ifdef YY_USE_PROTOS
  1058. void yy_load_buffer_state( void )
  1059. #else
  1060. void yy_load_buffer_state()
  1061. #endif
  1062.  
  1063.     {
  1064.     yy_n_chars = yy_current_buffer->yy_n_chars;
  1065.     yytext = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  1066.     yyin = yy_current_buffer->yy_input_file;
  1067.     yy_hold_char = *yy_c_buf_p;
  1068.     }
  1069.  
  1070.  
  1071. #ifdef YY_USE_PROTOS
  1072. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  1073. #else
  1074. YY_BUFFER_STATE yy_create_buffer( file, size )
  1075. FILE *file;
  1076. int size;
  1077. #endif
  1078.  
  1079.     {
  1080.     YY_BUFFER_STATE b;
  1081.  
  1082.     b = (YY_BUFFER_STATE) malloc( sizeof( struct yy_buffer_state ) );
  1083.  
  1084.     if ( ! b )
  1085.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1086.  
  1087.     b->yy_buf_size = size;
  1088.  
  1089.     /* yy_ch_buf has to be 2 characters longer than the size given because
  1090.      * we need to put in 2 end-of-buffer characters.
  1091.      */
  1092.     b->yy_ch_buf = (YY_CHAR *) malloc( (unsigned) (b->yy_buf_size + 2) );
  1093.  
  1094.     if ( ! b->yy_ch_buf )
  1095.     YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  1096.  
  1097.     yy_init_buffer( b, file );
  1098.  
  1099.     return ( b );
  1100.     }
  1101.  
  1102.  
  1103. #ifdef YY_USE_PROTOS
  1104. void yy_delete_buffer( YY_BUFFER_STATE b )
  1105. #else
  1106. void yy_delete_buffer( b )
  1107. YY_BUFFER_STATE b;
  1108. #endif
  1109.  
  1110.     {
  1111.     if ( b == yy_current_buffer )
  1112.     yy_current_buffer = (YY_BUFFER_STATE) 0;
  1113.  
  1114.     free( (char *) b->yy_ch_buf );
  1115.     free( (char *) b );
  1116.     }
  1117.  
  1118.  
  1119. #ifdef YY_USE_PROTOS
  1120. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  1121. #else
  1122. void yy_init_buffer( b, file )
  1123. YY_BUFFER_STATE b;
  1124. FILE *file;
  1125. #endif
  1126.  
  1127.     {
  1128.     b->yy_input_file = file;
  1129.  
  1130.     /* we put in the '\n' and start reading from [1] so that an
  1131.      * initial match-at-newline will be true.
  1132.      */
  1133.  
  1134.     b->yy_ch_buf[0] = '\n';
  1135.     b->yy_n_chars = 1;
  1136.  
  1137.     /* we always need two end-of-buffer characters.  The first causes
  1138.      * a transition to the end-of-buffer state.  The second causes
  1139.      * a jam in that state.
  1140.      */
  1141.     b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1142.     b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
  1143.  
  1144.     b->yy_buf_pos = &b->yy_ch_buf[1];
  1145.  
  1146.     b->yy_eof_status = EOF_NOT_SEEN;
  1147.     }
  1148. # line 54 "bezier_l.l"
  1149.  
  1150.  
  1151. #ifndef FLEX_SCANNER
  1152. int
  1153. yywrap()
  1154. {
  1155.     return 1;
  1156. }
  1157. #endif
  1158.  
  1159.  
  1160.